<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <script th:inline="javascript">
     //从ES6开始,我们就可以进行精准地定义变量的作用域了,let、const
     let message = '[[${country}]]';
     alert(message);
     let list = '[[${list}]]';
     alert(list);
  </script>
  <style th:inline="css">
     p{
       color: [[${color}]];
     }
  </style>
</head>
<body>
  <p>这是一段文字</p>
  <hr/>
  <p th:text="${color}"></p>
  <p th:text="${session.color}"></p>
<!--  <p th:text="${servletContext.color}"></p>-->
  <p th:text="${#servletContext.getAttribute('color')}"></p>
</body>
</html>